package alex.edu;

import android.app.Activity;
import android.app.NotificationManager;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class UpdateActivity extends Activity {

	NotificationManager notificationManager;
	
	public void onCreate(Bundle icicle) {
		super.onCreate(icicle);
		setContentView(R.layout.update_layout);
		Button update = (Button) this.findViewById(R.id.update_button);
		update.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				switchToTheList();
			}
		});
		String svcName = Context.NOTIFICATION_SERVICE;
		notificationManager = (NotificationManager)getSystemService(svcName);
		notificationManager.cancel(StatusService.NOTIFICATION_ID);
		TextView textview = (TextView) this.findViewById(R.id.update_textView);
		textview.setText((StatusService.number_of_update  - 1 )+ " status updated recived");
	}

	private void switchToTheList() {
//		Intent i = new Intent(this, StatusesActivity.class);
//		startActivity(i);
		finish();
	}
}
